import request from "../http.js";

// 书籍全部请求api


// 获取书籍详情
export function getBookinfo(id) {
    return request({
        url: `/book-info/${id}`,
        method: 'get',
    })
}



// 获取书籍源
// /book-sources?view=summary&book={book}
export function getSources(id) {
    return request({
        url: `/book-sources?view=summary&book=${id}`,
        method: 'get',
    })
}

// 获取书籍章节列表（各章节 返回各章节link）
// /btoc/书籍id?view=chapters&channel=mweb
// /atoc/书籍id?view=chapters&channel=mweb
export function getChapter(id) {
    return request({
        url: `/book-chapters/${id}`,
        method: 'get',
    })
}
// 获取书籍章节内容
export function getbook(link) {

    // console.log(encodeURIComponent(link))
    return request({
        url: `/chapters/${encodeURIComponent(link)}`,
        method: 'get',
    })
}